Conversation
- Completely remove setup.py. - Bump major version of the package to 6.0.0. - Update appium/version.py with a static version string for consistency. - Sync pyproject.toml and appium/version.py via semantic-release configuration. - Update CHANGELOG.md.
|
Some more AI findings: |
py.typed: Confirmed it's included in the built wheel. Hatchling automatically picks up all files under the appium package directory, so no extra config is needed. |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s packaging/versioning by removing the legacy setup.py flow and shifting installation guidance to pip install ., while attempting to align version management with pyproject.toml and semantic-release.
Changes:
- Removed
setup.pyto fully rely onpyproject.toml/PEP 517 builds. - Updated
pyproject.tomlsemantic-release settings and removed Hatch’s version config. - Changed runtime version retrieval in
appium/version.pyand updated README install commands.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools entrypoint. |
| pyproject.toml | Removes Hatch version config; updates semantic-release version sync settings. |
| appium/version.py | Changes how the package version is resolved at runtime. |
| README.md | Replaces python setup.py install with pip install .. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from importlib.metadata import version as _metadata_version | ||
|
|
||
|
|
||
| def _get_version(): | ||
| return metadata.version('Appium-Python-Client') | ||
|
|
||
|
|
||
| version = _get_version() | ||
| version = _metadata_version('Appium-Python-Client') |
There was a problem hiding this comment.
version = _metadata_version('Appium-Python-Client') will raise importlib.metadata.PackageNotFoundError when the distribution metadata is not available (e.g., running from a source checkout without an installed wheel/sdist), which makes importing appium.version fail. Wrap the metadata lookup in a try/except and fall back to a safe value (the PR description mentions returning 'unknown').
There was a problem hiding this comment.
the PR description needs to be updated
| from importlib.metadata import version as _metadata_version | ||
|
|
||
|
|
||
| def _get_version(): | ||
| return metadata.version('Appium-Python-Client') | ||
|
|
||
|
|
||
| version = _get_version() | ||
| version = _metadata_version('Appium-Python-Client') |
There was a problem hiding this comment.
The PR description says _get_version() was improved to handle missing package metadata and return 'unknown', but _get_version() was removed and the module now unconditionally queries metadata at import time. Either reintroduce a helper with the documented fallback behavior or adjust the PR description to match the implemented behavior.
| no_git_verify = false | ||
| tag_format = "v{version}" | ||
| version_toml = ["pyproject.toml:project.version"] | ||
| version_toml = ["pyproject.toml:project.version", "appium/version.py:version"] |
There was a problem hiding this comment.
version_toml is configured to update appium/version.py:version, but version_toml entries are typically TOML key paths (and appium/version.py is not a TOML file). If the intent is to have python-semantic-release bump a Python variable, use the configuration option intended for Python version variables (and ensure appium/version.py contains a literal version string assignment that the tool can rewrite). Otherwise the release process may fail when trying to parse/update this entry.
| version_toml = ["pyproject.toml:project.version", "appium/version.py:version"] | |
| version_toml = ["pyproject.toml:project.version"] | |
| version_variables = ["appium/version.py:version"] |
There was a problem hiding this comment.
Removed appium/version.py:version from version_toml. Since version.py now reads the version dynamically from installed package metadata (importlib.metadata), python-semantic-release only needs to bump the version in pyproject.toml - the runtime value follows automatically.
This pull request modernizes the packaging and installation process for the Appium Python client by removing legacy
setup.pysupport and updating documentation and versioning configuration. The main focus is on fully adopting PEP 517/518 standards withpyproject.tomland streamlining version management.Packaging and Installation Modernization:
setup.pyfile, fully transitioning topyproject.tomland PEP 517/518 standards for building and installing the package.README.mdto usepip install .instead ofpython setup.py install, reflecting modern Python packaging best practices.Version Management Improvements:
appium/version.pyby directly usingimportlib.metadata.version, removing unnecessary indirection.pyproject.tomlto synchronize versioning betweenpyproject.tomlandappium/version.pyfor better consistency with semantic release tooling.[tool.hatch.version]section frompyproject.toml, as version management is now handled elsewhere.